/**
 * 
 */
package algorithm.sort;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * TestCompareInt.java. 2011-11-17上午10:52:52 @author LionBule.
 */
public class TestCompareInt {

    /**
     * @param args
     */
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>();
        list.add(10);
        list.add(1);
        list.add(3);
        System.out.println(list.toString());
        
        Collections.sort(list, new Comparator<Integer>() {

            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });
        
        System.out.println(list.toString());
        
    }

}
